<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>二级导航</title>
  </head>
  <style>
    a {
      text-decoration: none;
    }
    li {
      list-style: none;
      padding: 0;
      margin: 0;
    }
    ol {
      padding: 0;
      margin: 0;
    }
    .navbar {
      width: 1200px;
      height: 49px;
      background-color: aquamarine;
      margin: auto;
    }
    .nav {
      width: 100%;
      height: 49px;
      background-color: azure;
    }
    .nav ul {
      display: flex;
      justify-content: space-around;
    }
    .nav ul > li {
      position: relative;
    }
    .nav ul li > a {
      display: block;
      width: 100px;
      padding: 0 10px;
      line-height: 49px;
      text-align: center;
    }

    .nav ul > li ol {
      background-color: bisque;
      position: absolute;
      max-height: 0px;
      transition: 0.3s;
      overflow: hidden;
    }
    .nav ul > li:hover ol {
      max-height: 500px;
    }
  </style>
  <body>
    <div class="navbar">
      <div class="nav">
        <ul>
          <li>
            <a href="javascript:;">菜单一</a>
          </li>
          <li>
            <a href="javascript:;">菜单二</a>
            <ol>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
            </ol>
          </li>
          <li>
            <a href="javascript:;">菜单二</a>
            <ol>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
            </ol>
          </li>
          <li>
            <a href="javascript:;">菜单三</a>
            <ol>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
            </ol>
          </li>
          <li>
            <a href="javascript:;">菜单四</a>
            <ol>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
              <li>
                <a href="javascript:;">菜单二-1</a>
              </li>
            </ol>
          </li>
        </ul>
      </div>
    </div>
  </body>
</html>
